package org.dtrd.modules.archive.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.archive.entity.bean.ReverseSchemeDetail;

import java.util.Date;


/**
 * <p>
 * 逆转方案
 * </p>
 *
 * @author QR
 * @since 2022-01-10
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_archive_reverse_scheme")
public class DtrdEntRdArchiveReverseScheme {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 患者id
     */
    @TableField("patient_id")
    private Integer patientId;

    /**
     * 服务模版id
     */
    @TableField("service_template_id")
    private Integer serviceTemplateId;

    /**
     * 打卡模版id
     */
    @TableField("signin_template_id")
    private Integer signinTemplateId;

    /**
     * 患者和服务关联id
     */
    @TableField("relation_id")
    private Integer relationId;

    /**
     * 生活方式评估
     */
    @TableField("life_plan")
    private String lifePlan;

    /**
     * 用药方案
     */
    @TableField("drug_plan")
    private String drugPlan;

    /**
     * 知情同意书
     */
    @TableField("consent_image")
    private String consentImage;
    /**
     * 服务协议
     */
    @TableField("protocol_image")
    private String protocolImage;

    /**
     * 饮食方案
     */
    @TableField("diet_plan")
    private String dietPlan;

    /**
     * 运动方案
     */
    @TableField("sport_plan")
    private String sportPlan;

    /**
     * 服务开始时间
     */
    @TableField("service_start_time")
    private Date serviceStartTime;

    /**
     * 饮食原则, 1-低碳, 2-低盐
     */
    @TableField("principle_diet")
    private String principleDiet;

    /**
     * 蛋白质摄入原则, 1-1-1.0g/日, 2-针对贫血改善
     */
    @TableField("principle_protein")
    private String principleProtein;

    /**
     * 运动原则, 1-循序渐进, 2-有氧, 3-有氧+增肌, 4-运动强度酌情限制
     */
    @TableField("principle_sport")
    private String principleSport;

    /**
     * 其他
     */
    @TableField("other")
    private String other;

    @TableField("create_time")
    private Date createTime;

    @TableField("create_by")
    private String createBy;

    @TableField("update_time")
    private Date updateTime;

    @TableField("update_by")
    private String updateBy;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdArchiveReverseScheme init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdArchiveReverseScheme parseFromDTO(ReverseSchemeDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        serviceTemplateId = dto.getServiceTemplateId();
        signinTemplateId = dto.getSigninTemplateId();
        consentImage = dto.getConsentImage();
        protocolImage=dto.getProtocolImage();
        lifePlan = dto.getLifePlan();
        drugPlan = dto.getDrugPlan();
        dietPlan = dto.getDietPlan();
        sportPlan = dto.getSportPlan();
        serviceStartTime = dto.getServiceStartTime();
        principleDiet = dto.getPrincipleDiet();
        principleProtein = dto.getPrincipleProtein();
        principleSport = dto.getPrincipleSport();
        other = dto.getOther();
        return this;
    }


}
